<!doctype html>

<html lang="zh-cn" class="light-style layout-menu-fixed layout-compact" dir="ltr" data-theme="theme-default"
  data-assets-path="/static/HubUI/assets/" data-template="vertical-menu-template-free" data-style="light">

<head>
  <meta charset="utf-8" />
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />

  <title>
    {% block title %}
    碎嘴子Hub管理
    {% endblock %}
  </title>

  <meta name="description" content="" />

  <!-- Favicon -->
  <link rel="icon" type="image/x-icon" href="/static/HubUI/assets/img/favicon/favicon.ico" />


  <link href="/static/HubUI/fonts/no1.css" rel="stylesheet" />

  <link rel="stylesheet" href="/static/HubUI/assets/vendor/fonts/boxicons.css" />

  <!-- Core CSS -->
  <link rel="stylesheet" href="/static/HubUI/assets/vendor/css/core.css" class="template-customizer-core-css" />
  <link rel="stylesheet" href="/static/HubUI/assets/vendor/css/theme-default.css"
    class="template-customizer-theme-css" />
  <link rel="stylesheet" href="/static/HubUI/assets/css/demo.css" />

  <!-- Vendors CSS -->
  <link rel="stylesheet" href="/static/HubUI/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.css" />
  <link rel="stylesheet" href="/static/HubUI/assets/vendor/libs/apex-charts/apex-charts.css" />

  <!-- Page CSS -->

  <!-- Helpers -->
  <script src="/static/HubUI/assets/vendor/js/helpers.js"></script>
  <!--! Template customizer & Theme config files MUST be included after core stylesheets and helpers.js in the <head> section -->
  <!--? Config:  Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file.  -->
  <script src="/static/HubUI/assets/js/config.js"></script>

  {% block css %}
  {% endblock %}
</head>

<body>
  <!-- Layout wrapper -->
  <div class="layout-wrapper layout-content-navbar">
    <div class="layout-container">
      <!-- Menu -->
      {% block nav_left %}
      {% endblock %}
      <!-- -->

      <!-- / Menu -->

      <!-- Layout container -->
      <div class="layout-page">
        <!-- Navbar -->
        {% block NavBar %}
        {% endblock %}


        <!-- / Navbar -->

        <!-- Content wrapper -->
        <div class="content-wrapper">
          <!-- Content -->

          <div class="container-xxl flex-grow-1 container-p-y">
            {% block content %}
            {% endblock %}
          </div>
          <!-- / Content -->

          <!-- Footer -->
          {% block footer %}{% endblock %}
          <!-- / Footer -->

          <div class="content-backdrop fade"></div>
        </div>
        <!-- Content wrapper -->
      </div>
      <!-- / Layout page -->
    </div>

    <!-- Overlay -->
    <div class="layout-overlay layout-menu-toggle"></div>
  </div>
  <!-- / Layout wrapper -->

  <!-- <div class="buy-now">
      <a
        href="https://themeselection.com/item/sneat-dashboard-pro-bootstrap/"
        target="_blank"
        class="btn btn-danger btn-buy-now"
        >升级到专业版</a
      >
    </div> -->

  <!-- Core JS -->
  <!-- build:js assets/vendor/js/core.js -->
  <script src="/static/HubUI/js/axios.min.js"></script>
  <script>
    // 设置axios的默认请求
    axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';

    // 读取本地的userInfo


  </script>
  <script src="/static/HubUI/assets/vendor/libs/jquery/jquery.js"></script>
  <script src="/static/HubUI/assets/vendor/libs/popper/popper.js"></script>
  <script src="/static/HubUI/assets/vendor/js/bootstrap.js"></script>
  <script src="/static/HubUI/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
  <script src="/static/HubUI/assets/vendor/js/menu.js"></script>

  <!-- endbuild -->

  <!-- Vendors JS -->
  <script src="/static/HubUI/assets/vendor/libs/apex-charts/apexcharts.js"></script>

  <!-- Main JS -->
  <script src="/static/HubUI/assets/js/main.js"></script>

  <!-- Page JS -->
  <script src="/static/HubUI/assets/js/dashboards-analytics.js"></script>
  <script src="/static/HubUI/js/Hub.js"></script>
  <script>
    // 自定义JS
    
    // 添加请求拦截器
    axios.interceptors.request.use(async function (config) {
      // 判断是否是POST请求
      
      if (config.method === 'post') {
        let userInfo = getUserInfo();

        if (userInfo) {config.headers['Authorization'] = `${userInfo.user_id}`;}
        // config.headers['Authorization'] = `1234`;
        // 获取CSRFToken
        const csrfToken = await getCSRFToken();
        console.log(csrfToken);
        config.headers['X-CSRFToken'] = csrfToken;
      }
      // 在发送请求之前做些什么
      return config;  
    }, function (error) {
      // 对请求错误做些什么
      return Promise.reject(error);
    });
  </script>
  {% block js %}
  {% endblock %}
</body>

</html>